home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / network / daemons / linux-1.000 < prev    next >
Encoding:
Text File  |  1996-11-17  |  9.3 KB  |  313 lines

  1. diff -u --recursive --new-file --exclude-from=exclude gated.vanilla/INSTALL gated/INSTALL
  2. --- gated.vanilla/INSTALL    Wed Sep 20 21:21:02 1995
  3. +++ gated/INSTALL    Sat Oct  7 18:57:56 1995
  4. @@ -36,6 +36,9 @@
  5.      Install this config file in the previously created object directory with 
  6.      the name Config. 
  7.  
  8. +    Under Linux you will need either 40Mb of virtual memory or to use BSD or
  9. +    minix free versions of sed to build the configurations.
  10. +
  11.   3. Configure GateD for this architecture by typing make config. This will run
  12.      an awk script on your obj.`src/util/archtype`/Config file which builds a 
  13.      sed script. This sed script is used to edit a Makefile template. The
  14. diff -u --recursive --new-file --exclude-from=exclude gated.vanilla/Linux.TODO gated/Linux.TODO
  15. --- gated.vanilla/Linux.TODO    Thu Jan  1 01:00:00 1970
  16. +++ gated/Linux.TODO    Mon Oct  9 09:19:57 1995
  17. @@ -0,0 +1,132 @@
  18. +Changes and instructions for getting gated to build and run under
  19. +Linux 1.3.x
  20. +
  21. +
  22. +Pre-requisites:
  23. +    Linux 1.2 or higher.
  24. +    Linux 1.3 or higher for multicast using protocols to work
  25. +        multi interface.
  26. +    40Mb virtual memory (or 8Mb and a non GNU sed)
  27. +    libc4.6.27 or higher.
  28. +
  29. +TODO
  30. +    Simon Janes is working on a route/header cache for high speed
  31. +        forwarding.
  32. +
  33. +    BTV has mostly written the second level routing cache code.
  34. +
  35. +    Alan Cox is working on a proper tree based routing table for
  36. +        use in large routing table environments (BGP notably)
  37. +
  38. +    At the moment Linux does not make a good BGP router due to the
  39. +    route lookup overhead with large routing tables.
  40. +
  41. +    Implement multipath routing.
  42. +
  43. +    Fix the makefiles to put gated into /usr/local/sbin as well, as
  44. +        is required by the FSSTND.
  45. +    
  46. +    Kernel->daemon message based routing updates are not supported
  47. +        by gated (/dev/route)
  48. +
  49. +    Gated doesn't know about the dummy device as an RTF_BLACKHOLE
  50. +        equivalent
  51. +
  52. +    Linux /proc/net/routes is still quite slow to read when very large
  53. +
  54. +    RTF_STATIC
  55. +
  56. +    Look at merging rip98 and rspf amateur radio routing daemons into
  57. +        gated, instead of standalone, or at least able to interace.
  58. +
  59. +    Check the enabled variable subnet masks which Linux _does_ support by the
  60. +        ioctl() interface unlike BSD4.3
  61. +
  62. +    How should we use and reflect the Linux mtu/window settings 
  63. +        on routes ?
  64. +
  65. +Changes to gated
  66. +
  67. +o        note the GNU sed problem in INSTALL
  68. +
  69. +o        removed bsd/ include dependencies.
  70. +    
  71. +o        Fixed the /proc readers to handle /proc/net/snmp and
  72. +        the routing table correctly for future Linux versions
  73. +
  74. +o        Gated icmp.c doesnt even compile with NO_IPHEADER defined
  75. +        I am not confident the code for this is right. Linux routing 1.3 ignores ICMP redirect
  76. +
  77. +o        Variable masks must be defined for linux. It uses the ioctl
  78. +        interface with an extra sockaddr carrying the mask.
  79. +Changes to Linux includes
  80. +
  81. +o        If building with libc4.6.27+mroute include patches you will
  82. +        need to correct sys/socketios.h to be sys/sockio.h and make
  83. +        it include linux/sockios.h not linux/socketios.h
  84. +
  85. +o        Use the latest libc BSD compat for netinet/ip.h and add
  86. +        IP_DF defines as follows if they are not already present
  87. +
  88. +Changes to Linux kernel as of 1.3.33
  89. +
  90. +o        Lined up the error returns to match the expected BSD ones.
  91. +        Its not easy to do this as the Linux kernel blocks a routing
  92. +        update momentarily until resources are free rather than
  93. +        returning ENOBUFS, allows a replacement of a route with the
  94. +        same target/mask by just doing an ADD (ie it has a change
  95. +        operation). As of 1.3.32 it does now report ESRCH on a 
  96. +        delete of unknown route (previously no error).
  97. +        These are really just cleanups and not vital to
  98. +        functionality.
  99. +
  100. +o        Faster /proc/net/routes
  101. +
  102. +o        IP support for /dev/route is completed but not used by
  103. +        Gated.
  104. +
  105. +--------------
  106. +
  107. +#include <linux/ip.h>
  108. +
  109. +#ifdef _BSD_SOURCE
  110. +
  111. +/*
  112. + *    BSD has the following structure
  113. + */
  114. +struct ip
  115. +{
  116. +#if defined(__LITTLE_ENDIAN_BITFIELD)
  117. +    __u8    ip_hl:4,
  118. +        ip_v:4;
  119. +#else
  120. +    __u8    ip_v:4,
  121. +        ip_hl:4;
  122. +#endif
  123. +#define IPVERSION    4
  124. +    __u8    ip_tos;
  125. +    __u16    ip_len;
  126. +    __u16    ip_id;
  127. +    __u16    ip_off;
  128. +    __u8    ip_ttl;
  129. +    __u8    ip_p;
  130. +    __u16    ip_csum;
  131. +    struct    in_addr ip_src,ip_dst;
  132. +};
  133. +
  134. +#define IP_DF    0x4000
  135. +
  136. +#endif
  137. +
  138. +------------
  139. +
  140. +    On older libc's add /usr/include/net/route.h as
  141. +
  142. +------------
  143. +
  144. +#include <linux/route.h>
  145. +
  146. +------------
  147. +
  148. diff -u --recursive --new-file --exclude-from=exclude gated.vanilla/src/configs/linux.smp gated/src/configs/linux.smp
  149. --- gated.vanilla/src/configs/linux.smp    Thu Jan  1 01:00:00 1970
  150. +++ gated/src/configs/linux.smp    Sat Oct  7 17:34:50 1995
  151. @@ -0,0 +1,54 @@
  152. +#
  153. +#    roadrunner,v 1.0 1994/03/18 19:03:03 Alan Cox
  154. +#
  155. +#    Config file for roadrunner (Linux/SMP dual P90 1.3.32)
  156. +#
  157. +
  158. +bindir  /usr/local/sbin
  159. +sbindir    /usr/local/etc
  160. +mandir    /usr/local/man
  161. +
  162. +cwflags    -W -Wunused -Wreturn-type -Wcast-qual -Wpointer-arith -Wwrite-strings -Wcomment -Wswitch -Wshadow -Waggregate-return -Wformat -Wuninitialized -Wmissing-prototypes -Wcast-align -Winline
  163. +cflags    -O -g 
  164. +
  165. +lex    flex
  166. +lflags    -p -s -C -I
  167. +
  168. +mkdep    mkdep -flag -M
  169. +
  170. +yacc    bison
  171. +yflags    -d -y -v
  172. +
  173. +options    NEED_INET_ATON
  174. +options    NO_MBUF_H
  175. +options    INCLUDE_UNISTD
  176. +options    INCLUDE_TYPES 
  177. +options    INCLUDE_SOCKIO
  178. +options    INCLUDE_PATHS 
  179. +options USE_SETPGRP
  180. +options    HAVE_DIRENT
  181. +options    GID_T=int
  182. +options    POSIX_SIGNALS
  183. +options NEED_SIGNAME
  184. +options    HAVE_SYS_SIGLIST
  185. +options    HAVE_WAITPID
  186. +options    KRT_RTREAD_PROC
  187. +options    KRT_LLADDR_LINUX
  188. +options    ROUTES_WO_MBUFS
  189. +options    KRT_IFREAD_IOCTL
  190. +options    KRT_RT_IOCTL
  191. +options KRT_SYMBOLS_PROC  
  192. +options KRT_SOCKET_TYPE=PF_INET,SOCK_DGRAM,AF_UNSPEC
  193. +options KVM_TYPE_NONE
  194. +options ICMP_NOIP_HEADER
  195. +options VARIABLE_MASKS
  196. +options tzsetwall()={unsetenv("TZ");tzset();}
  197. +
  198. +path_config    /etc/%s.conf
  199. +path_dump    /var/tmp/%s_dump
  200. +path_dumpdir    /var/tmp
  201. +path_pid    /var/run/%s.pid
  202. +path_version    /var/run/%s.version
  203. +
  204. +protocols    bgp egp hello icmp ospf rip 
  205. +
  206. diff -u --recursive --new-file --exclude-from=exclude gated.vanilla/src/icmp.c gated/src/icmp.c
  207. --- gated.vanilla/src/icmp.c    Wed Sep 20 21:21:27 1995
  208. +++ gated/src/icmp.c    Sat Oct  7 21:49:39 1995
  209. @@ -433,8 +433,9 @@
  210.  
  211.      dst = sockbuild_in(0, ip->ip_dst.s_addr);
  212.  #else    /* ICMP_NOIP_HEADER */
  213. -    if (task_recv_dstaddr
  214. -        && sock2in(task_recv_dstaddr)) {
  215. +    if (task_recv_dstaddr)
  216. +    {
  217. +        sock2in(task_recv_dstaddr);
  218.          /* Destination address is valid */
  219.  
  220.          dst = task_recv_dstaddr;
  221. diff -u --recursive --new-file --exclude-from=exclude gated.vanilla/src/include.h gated/src/include.h
  222. --- gated.vanilla/src/include.h    Wed Sep 20 21:21:28 1995
  223. +++ gated/src/include.h    Sat Oct  7 21:21:13 1995
  224. @@ -82,9 +82,9 @@
  225.  #include <netinet/in.h>
  226.  #ifdef    linux
  227.  #include <bsd/bsd.h>
  228. -#include <linux/in_systm.h>       
  229. -#include <bsd/netinet/ip_var.h>   
  230. -#include <bsd/netinet/ip.h>       
  231. +#include <netinet/in_systm.h>       
  232. +/*#include <netinet/ip_var.h>   */
  233. +#include <netinet/ip.h>       
  234.  #else /* linux */
  235.  #include <netinet/in_systm.h>
  236.  #include <netinet/ip.h>
  237. @@ -113,11 +113,7 @@
  238.  #endif
  239.  
  240.  #ifdef    INCLUDE_UDP
  241. -#ifdef    linux
  242. -#include <linux/udp.h>
  243. -#else    /* linux */
  244.  #include <netinet/udp.h>
  245. -#endif    /* linux */
  246.  #endif
  247.  #ifdef    INCLUDE_UDP_VAR
  248.  #include <netinet/udp_var.h>
  249. diff -u --recursive --new-file --exclude-from=exclude gated.vanilla/src/krt_rt_ioctl.c gated/src/krt_rt_ioctl.c
  250. --- gated.vanilla/src/krt_rt_ioctl.c    Wed Sep 20 21:21:43 1995
  251. +++ gated/src/krt_rt_ioctl.c    Sun Oct  8 01:15:10 1995
  252. @@ -61,6 +61,9 @@
  253.      krt.rt_dst = *sock2unix(dest, (int *) 0);        /* struct copy */
  254.      krt.rt_gateway = *sock2unix(router, (int *) 0);    /* struct copy */
  255.      krt.rt_flags = krt_state_to_flags(krtp->krtp_state);
  256. +#ifdef VARIABLE_MASKS
  257. +    krt.rt_genmask = *sock2unix(mask, (int *) 0);    /* struct copy */
  258. +#endif    
  259.      if (sockishost(dest, mask)) {
  260.      BIT_SET(krt.rt_flags, RTF_HOST);
  261.      }
  262. diff -u --recursive --new-file --exclude-from=exclude gated.vanilla/src/krt_rtread_proc.c gated/src/krt_rtread_proc.c
  263. --- gated.vanilla/src/krt_rtread_proc.c    Wed Sep 20 21:21:44 1995
  264. +++ gated/src/krt_rtread_proc.c    Sat Oct  7 21:33:08 1995
  265. @@ -39,6 +39,7 @@
  266.      rt_parms rtparms;
  267.      FILE *DFile;
  268.      if_addr *ifap;
  269. +    char buf[256];        /* Buffer space */
  270.  
  271.      bzero((caddr_t) &rtparms, sizeof (rtparms));
  272.      rtparms.rtp_n_gw = 1;
  273. @@ -54,10 +55,17 @@
  274.      /* read route data from /proc   */
  275.  
  276.  /* skip over header line */
  277. -    i=fscanf(DFile,"%*s\t%*s\t%*s\t%*s\t%*s\t%*s\t%*s\t%*s\t%*s\t%*s\n");
  278. +    fgets(buf,256,DFile);
  279.  
  280. -    while(!feof(DFile)){
  281. -    i=fscanf(DFile,"%s\t%lx\t%lx\t%02x\t%*d\t%*d\t%*d\t%lx\t%*d\t%*d\n",
  282. +/*
  283. + *    It is important we use fgets here. The linux /proc files will keep the same order
  284. + *    through releases but new entries can appear at the end of each line. This changed
  285. + *    reader will always stay in sync.
  286. + *        -- Alan Cox.
  287. + */
  288. +    while(fgets(buf,256,DFile))
  289. +    {
  290. +    i=sscanf(buf,"%s\t%lx\t%lx\t%02x\t%*d\t%*d\t%*d\t%lx\t%*d\t%*d\n",
  291.           if_name,
  292.           &addr_dest,
  293.           &addr_gw,
  294. diff -u --recursive --new-file --exclude-from=exclude gated.vanilla/src/krt_symbols_proc.c gated/src/krt_symbols_proc.c
  295. --- gated.vanilla/src/krt_symbols_proc.c    Wed Sep 20 21:21:45 1995
  296. +++ gated/src/krt_symbols_proc.c    Sat Oct  7 21:34:57 1995
  297. @@ -35,7 +35,12 @@
  298.      fclose (fp);
  299.      }
  300.      if (resp) {
  301. -    inet_ipforwarding = atoi(resp) > 0;
  302. +        /*
  303. +         *    1.2 kernels report '0' for not forwarding, which is an
  304. +         *    error. The SNMP 'not forwarding' value is 2. This is
  305. +         *    fixed in 1.3.x systems.
  306. +         */
  307. +    inet_ipforwarding = (atoi(resp) == 1);
  308.      trace_tp(tp,
  309.           TR_KRT_SYMBOLS,
  310.           0,
  311.